LATEX=pdflatex
TEXFILES=$(wildcard *.tex)
BIBTEX=bibtex
BIBFILE=references.bib
PAPER=Lakhina_Shay_274

all: make_figures $(PAPER).pdf

make_figures:
	$(MAKE) -C figures

bib:
	$(BIBTEX) $(PAPER)

$(PAPER).pdf: $(TEXFILES) $(BIBFILE)
	$(LATEX) $(PAPER)
	$(BIBTEX) $(PAPER)
	$(LATEX) $(PAPER)
	$(LATEX) $(PAPER)

clean:
	rm -f *.aux *.log *.pdf *.bbl *.blg *.gz .log
	$(MAKE) -C figures clean
